import cv2
import numpy as np

img = cv2.imread("F:/awei/code/opencv_source3.3/samples/data/chessboard.png")
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
gray = np.float32(gray)

dst = cv2.cornerHarris(gray, 2, 23, 0.04)
img[dst>0.01*dst.max()] = [0,0,255]
cv2.imwrite("image.jpg",img)
while (True):
    cv2.imshow("角点", img)
    if ( cv2.waitKey(1000 / 12) & 0xff == ord("q") ):
        break;
    cv2.destroyAllWindows()
